//
//  CartViewController.m
//  TestYoho
//
//  Created by YiDarren on 17/1/19.
//  Copyright © 2017年 YiDarren. All rights reserved.
//

#import "CartViewController.h"
#import "MBProgressHUD+JDragon.h"
#import "UITableView+Empty.h"


@interface CartViewController ()<UITableViewDataSource,UITableViewDelegate>

@property (weak, nonatomic) IBOutlet UITableView *tableView;

@property (nonatomic) NSMutableArray *dataArray;

@property (nonatomic) NSInteger numberOfSections;

@end

@implementation CartViewController

- (void)viewDidLoad {
    
    
    [super viewDidLoad];
    self.title = @"购物车";
    
    self.numberOfSections = 0;
    
    [self addNotePicBgView];
    
    [self.tableView reloadData];

}

#pragma mark -tableView无数据添加背景图片
-(void)addNotePicBgView {
    
    [self.tableView addNoteViewWithpicName:@"bg_no_grab" noteText:@"我们的需求是btn刷新、硬要下拉刷新看类别里" refreshBtnImg:@"bgbg"];
}
- (IBAction)reloadBtnAction:(id)sender {
    
    [self.tableView reloadData];
}


#pragma mark -
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 5;
    return self.numberOfSections;
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    
    return 1;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    return 44;
}

-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    
    return 0.1;
}

-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    
    return 0.1;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *cellID = @"cellID";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    cell.backgroundColor = [UIColor darkGrayColor];
    
    return cell;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    [MBProgressHUD showInfoMessage:@"下一步要做的事情就是go...dutch"];
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
